package com.sc.nft.entity.vo;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.UserEcologyHatchRecordsStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class PageHatchRecordsVO {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "藏品名称")
    private String collectionName;

    @ApiModelProperty(value = "藏品图片")
    private String collectionImage;

    @ApiModelProperty(value = "孵化周期(天)")
    private Integer hatchCycle;

    @ApiModelProperty(value = "已经持有了多少天")
    private Integer alreadyDay;

    @ApiModelProperty(value = "已经持有了多少天")
    private Integer remainingDay;

    @ApiModelProperty(value = "熔炼次数")
    private Integer hatchCount;

    @ApiModelProperty(value = "用户消耗数量(藏品)")
    private Integer useCount;

    @ApiModelProperty(value = "状态 : UNDER_WAY:进行中 ALREADY_ENDED:已结束")
    private UserEcologyHatchRecordsStatus status;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;

    public void setRemainingDay(Integer remainingDay) {
        this.remainingDay = remainingDay;

        if(remainingDay <=0){
            this.remainingDay = 0;
        }
    }
}
